// src/pages/room/widgets/say_doctor/index.tsx
import classNames from "classnames";
import styles from "@styles/room.module.scss";
import React from "react";
import { Avatar } from "antd-mobile";
import dateFormat from "dateformat";
import {MsgType} from "@enums/room";
interface Props {
    message: Message;
}

export default function Say_doctor({ message }: Props) {
    return (
        <div className={classNames(styles.chat, styles.doctor)}>
            <div className={styles.avatar}>
                <Avatar src={message.fromAvatar} />
            </div>
            <div className={styles.container}>
                <div className={styles.time}>{dateFormat(message.createTime, "HH:MM:ss")}</div>
                <div className={styles.content}> {message.msgType === MsgType.MsgImage ? (
                    <img src={message.msg.picture?.url} alt="" />
                ) : (
                    message.msg.content
                )}</div>
            </div>
        </div>
    );
}